package models

import (
	"github.com/jinzhu/gorm"
	_ "github.com/jinzhu/gorm/dialects/mysql"
	"log"
)

func ConnDb() *gorm.DB {
	db, err := gorm.Open("mysql", "root:root@(127.0.0.1:3306)/tblog?charset=utf8&parseTime=True&loc=Local")
	if err != nil {
		log.Fatal(err)
	}
	return db
}
